﻿@model Siser.Web.Models.Equipo

@{
    ViewBag.Title = "Editar equipo";
}
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />

@*Validación de usuario, para que no se pueda acceder a la página sin estar logueado *@
@if (@User.Identity.Name == "")
{
    Layout = null;
    <div style="width:800px; font-size:2em; height:500px; text-align:center; margin-top:100px" class="division">
    @Html.ActionLink("Ingrese como usuario válido...", "InicioSesion", "Cuenta")
    </div>
}
else
{
<div class="espacio">&nbsp</div>
<script src="@Url.Content("~/Scripts/jquery-1.5.1.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.autotab-1.1b.js")" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $('#NivelAlarma').autotab({ format: 'custom', pattern: '[<>]' });
        $('#Nombre').autotab({ format: 'custom', pattern: '[<>]' });
        $('#NumeroInventario').autotab({ format: 'custom', pattern: '[<>]' });
    });
	</script>
    using (Html.BeginForm())
    {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Editar equipo</legend>
        <div>&nbsp</div>
        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.Nombre)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Nombre, new { maxlength = 30, size = 30, onpaste = "return false" })
            @Html.ValidationMessageFor(model => model.Nombre)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.NumeroInventario)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.NumeroInventario, new { maxlength = 30, size = 30, onpaste = "return false" })
            @Html.ValidationMessageFor(model => model.NumeroInventario)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Vigencia)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Vigencia)
            @Html.ValidationMessageFor(model => model.Vigencia)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.InstalacionId, "Instalación")
        </div>
        <div class="editor-field">
            @Html.DropDownList("InstalacionId", String.Empty)
            @Html.ValidationMessageFor(model => model.InstalacionId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.EstadoMantencionId, "Estado de Mantención")
        </div>
        <div class="editor-field">
            @Html.DropDownList("EstadoMantencionId", String.Empty)
            @Html.ValidationMessageFor(model => model.EstadoMantencionId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SistemaId, "Sistema")
        </div>
        <div class="editor-field">
            @Html.DropDownList("SistemaId", String.Empty)
            @Html.ValidationMessageFor(model => model.SistemaId)
        </div>
        <div>&nbsp</div>
        <p>
            <input type="submit" value="Grabar" />
        </p>
    </fieldset>
    }

<div class="division">
    @Html.ActionLink("Volver", "Index")
</div>
}